﻿@{
    ViewBag.Title = "Bán hàng";
    var currentUser = Session[NCLCustomerManagement.Common.Constant.Constant.CURRENT_USER]
                       as NCLCustomerManagement.UI.Models.User.AuthenticatedUser;
    var username = currentUser.Username;
    var isAdmin = currentUser.IsAdmin;                       
}

@section scripts{
    <script src="/Scripts/Sale/Sale.js?t=@DateTime.Now.Millisecond"></script>

}



@section title{
Bán hàng
}

<div id="sale-list" class="area">
    <div class="btn-grp" style="margin-bottom: 10px;">
        @*   <div class="btn-toolbar">*@
        <div class="btn-group" style="float: right;">
            <a id="btnNew" class="btn btn-primary" href="/Sale/New"><span class="glyphicon glyphicon-plus" title="Thêm"></span></a>
            @if (isAdmin)
            {
                   
                <button id="btnDel" class="btn btn-danger"><span class="glyphicon glyphicon-remove" title="Xóa"></span></button>
            }


        </div>

        <div class="row">

            <div class="col-xs-3" style="padding-right: 0px; width: 217px;">
                <input id="txtFromDate" type="text" class="date-format form-control input-sm" placeholder="Từ ngày" />

            </div>
            <div class="col-xs-1" style="width: 10px!important; text-align: center; padding-top: 5px;">-</div>
            <div class="col-xs-3" style="padding-left: 0px; width: 217px;">
                <input id="txtToDate" type="text" class="date-format form-control input-sm" id="txtToDate" placeholder="Đến ngày" />
            </div>
        </div>


        @*</div>*@
        <div class="row" style="margin-top: 5px;">
            <div class="col-xs-3">
                <input type="text" class="form-control input-sm" id="txtCustomerPhone" placeholder="Điện thoại khách hàng" />


            </div>
            @* <div class="col-xs-3">
        
                @Html.DropDownList("cboCategory", ViewBag.CategorySelectList as SelectList, "Chọn nhóm SP", new { @class = "form-control input-sm" })
            </div>*@
            <div class="col-xs-3">
                @Html.DropDownList("cboProduct", ViewBag.ProductSelectList as SelectList, "Tất cả SP", new { @class = "form-control input-sm" })
            </div>
            <div class="col-xs-3">
                <button id="btnSearch" type="button" class="btn btn-primary btn-sm" onclick="onSearch();">
                    <span class="glyphicon glyphicon-search" title="Tìm"></span>
                </button>
            </div>
        </div>


    </div>

    <table id="list"></table>
    <div id="listPager" class="scroll" style="text-align: center;"></div>
    <div id="listPsetcols" class="scroll" style="text-align: center;"></div>
    <div class="row">
        <div class="col-xs-8">
        </div>
        <div class="col-xs-4">
            <p>
                Tổng thành tiền:
            <span id="spTotalValue" style="font-weight:bold; color:green;">0.00</span>
            </p>
            <p>
                Dự kiến dùng hết vào ngày:
            <span id="spExpiredDate" style="font-weight:bold; color:red;"></span>
            </p>
        </div>
    </div>
   
</div>

<div id="dialog-confirm" title="Xác nhận" style="display: none;">
    <p>
        <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
        Bạn có chắc muốn xóa những dòng đã chọn?
    </p>
</div>

<div id="editWindow" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Modal title</h4>
            </div>
            <div class="modal-body">
                <p>One fine body&hellip;</p>
            </div>

        </div>
        <!-- /.modal-content -->
    </div>
    <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
